package com.baizhi.service.imp;

import com.baizhi.entity.Guru;
import com.baizhi.dao.GuruDao;
import com.baizhi.service.GuruService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GuruServiceImp implements GuruService {

    @Resource
    private GuruDao guruDao;

    @Override
    public void addGuruBulk(List<Guru> gurus) {
        guruDao.insertGuruBulk(gurus);
    }

    @Override
    public List<Guru> findAll() {
        return guruDao.selectAll();
    }

    @Override
    public Guru findGuruByField(Guru guru) {
        return guruDao.selectGuruByField(guru);
    }

    @Override
    public void insertGuru(Guru guru) {
        guruDao.insertGuru(guru);
    }

    @Override
    public void removeGuruById(Integer guruId) {
        guruDao.deleteGuruById(guruId);
    }

    @Override
    public void removeMultiple(Integer[] ids) {
        guruDao.deleteMultiple(ids);
    }

    @Override
    public void renovateGuru(Guru guru) {
        guruDao.updateGuru(guru);
    }
}
